from zope.interface import Interface

class IBuffer(Interface):

    def clear():
        """Makes the buffer empty."""

    def append(obj):
        """Appends 'obj' to the buffer."""

    def get():
        """Returns the whole buffer."""

class IAlertPlugin(Interface):

    def sendAlert(msg):
        """Sends the alert msg"""

    def configure(cfg):
        """Configure the plugin"""

class INetworkFactory(Interface):

    def getAnswer(msg, protocol_instance):
        """Returns a deferred returning a string."""

    def buildProtocol(addr):
        """Returns a protocol returning a string."""

    def newConnection(protocol_instance, ipaddr):
        """Initializes the new connection"""

    def closeConnection(protocol_instance):
        """Cleans the closed connection's data"""

class IParserService(Interface):

    def getAnswer(msg, protocol_instance):
        """Returns a deferred returning a string."""

    def newConnection(protocol_instance, ipaddr):
        """Initializes the new connection"""

    def closeConnection(protocol_instance):
        """Cleans the closed connection's data"""

class IPlugins(Interface):

    def getNames():
        """Returns the names of all the implemented modules"""

    def getValue(name):
        """Returns a deferred returning the local time and a value in a list."""

    def getAlert(name):
        """Returns a deferred returning a value."""

    def getConfig(name):
        """Returns the parameters for the server's database in a string"""

    def configure(cfg):
        """Reads the configuration for the plugin."""

class INetPlugin(Interface):

    def makeService():
        """Returns the service."""

    def getName():
        """Returns the name of the networking plugin"""

